/*
 * @Author: your name
 * @Date: 2020-08-03 14:12:35
 * @LastEditTime: 2020-08-04 17:23:25
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \shopping_mall_app\src\services\search\index.js
 */
import config from '../../assets/js/conf/config';
import {request} from '../../assets/js/utils/request';

//最近搜索记录
export function getHotKeyWords(){
    return request(config.baseUrl+'/home/public/hotwords?token='+config.token);
}

//商品数据
export function getProductData(params){
    const { keywords, param, page, price1, price2, otype, cid } = params;
    return request(config.baseUrl+'/home/goods/search?kwords='+keywords+
    '&param='+param+'&page='+page+'&price1='+price1+'&price2='+price2+
    '&otype='+otype+'&cid='+cid+'&token='+config.token);
}

//获取分类数据
export function getClassifyData(){
    return request(config.baseUrl+'/home/category/menu?token='+config.token);
}

//获取商品属性
export function getGoodsParam(keywords){
    return request(config.baseUrl+'/home/goods/param?kwords='+keywords+'&token='+config.token)
}